
let form = layui.form
form.verify({
  same: function (value) {
    var uname = $('.layui-form input[name=password]').val()
    if (value !== uname) {
      return '两次输入的密码不一样'
    }
  }
})


$('.layui-form').on('submit',function(e){
    e.preventDefault()
    let data = $(this).serialize()
    $.ajax({
      type:'POST',
      url:'/admin/users',
      data:data,
      success: function (res) {
        layer.msg(res.message)
        console.log(res)
        if(res.status == 0){
          $('input').val('')
        }
      }
    })
    
})
